﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/ResponsiveTheme.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TaggerApp.Admin.Pages.LoanDevice.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style>  body {padding-top: 60px;padding-bottom: 40px;}      </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Please correct the following errors:" DisplayMode="BulletList" CssClass="alert alert-error" EnableClientScript="true" ValidationGroup="loanValidations" />
    <hr />
    <div class="row">
    <div>
    <fieldset>
        <legend>Loan a Device</legend>
        <table >
            <tr>
                <td><asp:Label ID="lblDeviceID" runat="server" Text="Device ID:"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtBoxDeviceID" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtBoxDeviceID" CssClass="text-error" Display="Dynamic" ErrorMessage="Device ID is required." ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="This field is required"></i>
                    </asp:RequiredFieldValidator>
                     <asp:RegularExpressionValidator ID="RegularExpressionValidator3" ControlToValidate="txtBoxDeviceID" ValidationExpression="[\d+]{0,4}" Display="Dynamic" EnableClientScript="true" ErrorMessage="Device ID only accepts numbers." runat="server" ValidationGroup="loanValidations">
                         <i class="icon-exclamation-sign" title="Invalid input"></i>
                     </asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblCurrentTime" runat="server" Text="Current Time"></asp:Label></td>
                <td><div class="input-prepend"><span class="add-on"><i class="icon-time"></i></span><asp:TextBox ID="txtCurrentTime" runat="server" ReadOnly="True"></asp:TextBox></div></td>
            </tr>
            <tr>
                <td><asp:Label ID="lblEstLoanTime" runat="server" Text="Estimate Loaning Time:"></asp:Label></td>
                <td>
                    <asp:DropDownList ID="loantimeDropDownList" runat="server" DataSourceID="SqlDSLoanTime" DataTextField="loanTimeDesc" DataValueField="loanTimeID"></asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDSLoanTime" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [tblLoanTime]"></asp:SqlDataSource>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="loantimeDropDownList" CssClass="text-error" Display="Dynamic" ErrorMessage="*Selection Required." InitialValue="Choose your estimate loan time" ValidationGroup="loanValidations"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="Label1" runat="server" Text="Loaner Name:"></asp:Label></td>
                <td><div class="input-prepend"><span class="add-on"><i class="icon-user"></i></span><asp:TextBox ID="txtBoxLoanerName" runat="server" CssClass="input-large"></asp:TextBox></div>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtBoxLoanerName" CssClass="text-error" Display="Dynamic" ErrorMessage="Loaner's Name is required." ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="This field is required"></i>
                    </asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator runat="server" EnableClientScript="True" ControlToValidate="txtBoxLoanerName" Display="Dynamic" ErrorMessage="Loaner's Name must be less than 50 characters." ValidationGroup="loanValidations" ValidationExpression="^.{0,50}$">
                        <i class="icon-exclamation-sign" title="Loaner's Name must be less than 50 characters."></i>
                    </asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="Label2" runat="server" Text="Loaner Email:"></asp:Label></td>
                <td><div class="input-prepend"><span class="add-on"><i class="icon-user"></i></span><asp:TextBox ID="txtBoxLoanerEmail" runat="server" CssClass="input-large"></asp:TextBox></div>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtBoxLoanerEmail" CssClass="text-error" Display="Dynamic" ErrorMessage="Loaner's Email is required." ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="This field is required"></i>
                    </asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator runat="server" ControlToValidate="txtBoxLoanerEmail" Display="Dynamic" ErrorMessage="Invalid format for Loaner's Email." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="Invalid format"></i>
                    </asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblBorrowerName" runat="server" Text="Borrower Name:"></asp:Label></td>
                <td><div class="input-prepend"><span class="add-on"><i class="icon-user"></i></span><asp:TextBox ID="txtBoxBorrowerName" runat="server" CssClass="input-large"></asp:TextBox></div>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtBoxBorrowerName" CssClass="text-error" Display="Dynamic" ErrorMessage="Borrower's Name is required." ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="This field is required"></i>
                    </asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" EnableClientScript="True" ControlToValidate="txtBoxBorrowerName" Display="Dynamic" ErrorMessage="Borrower's Name must be less than 50 characters." ValidationGroup="loanValidations" ValidationExpression="^.{0,50}$">
                        <i class="icon-exclamation-sign" title="Borrower's Name must be less than 50 characters."></i>
                    </asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblPhoneNumber" runat="server" Text="Borrower Phone Number:"></asp:Label></td>
                <td><asp:TextBox ID="txtBoxPhoneNumber" runat="server" CssClass="input-medium" TextMode="Phone" placeholder="123-345-6789"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtBoxPhoneNumber" CssClass="text-error" Display="Dynamic" ErrorMessage="Please enter correct format for Phone Number" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}" ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="Invalid format"></i>
                    </asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblEmailAddress" runat="server" Text="Borrower Email"></asp:Label></td>
                <td><div class="input-prepend"><span class="add-on"><i class="icon-envelope"></i></span><asp:TextBox ID="txtBoxEmailAddress" runat="server" CssClass="input-xlarge" placeholder="example@domain.com"></asp:TextBox></div>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtBoxEmailAddress" CssClass="text-error" Display="Dynamic" ErrorMessage="Borrower's Email is required." ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="This field is required"></i>
                    </asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtBoxEmailAddress" CssClass="text-error" Display="Dynamic" ErrorMessage="Invalid format for Borrower's Email." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="loanValidations">
                        <i class="icon-exclamation-sign" title="Invalid format"></i>
                    </asp:RegularExpressionValidator>
                </td>
            </tr>
        </table>
    </fieldset>
    </div>
    </div>
    <div id="button">
        <table>
            <tr>
                <td><asp:Button ID="btnClear" runat="server" CssClass="btn btn-danger" Text="Clear" OnClick="btnClear_Click" /></td>
                <td><asp:Button ID="btnSubmit" runat="server" CssClass="btn btn-primary" Text="Submit" OnClick="btnSubmit_Click" ValidationGroup="loanValidations" /></td>
            </tr>
        </table>

    </div>

</asp:Content>
